"use strict";
(self["webpackChunktoknow"] = self["webpackChunktoknow"] || []).push([[689],{

/***/ 8585:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _TextArea_vue_vue_type_template_id_8551dff6_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6076);
/* harmony import */ var _TextArea_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1061);
/* harmony import */ var D_Project_ToKnow_Front_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3744);




;


const __exports__ = /*#__PURE__*/(0,D_Project_ToKnow_Front_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(_TextArea_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, [['render',_TextArea_vue_vue_type_template_id_8551dff6_scoped_true__WEBPACK_IMPORTED_MODULE_0__/* .render */ .s],['__scopeId',"data-v-8551dff6"]])

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);

/***/ }),

/***/ 6766:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });

  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
    props: {
      value: {
        type: String,
        default: () => ''
      },
    },
    emits: ['update:value'],
    methods: {
      handleInput(event) {
        this.$emit('update:value', event.target.value)
      }
    },
  });


/***/ }),

/***/ 5689:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": () => (/* binding */ PubSource)
});

// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/PubSource.vue?vue&type=template&id=36e3e39d&scoped=true


function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_source_upload = (0,runtime_core_esm_bundler/* resolveComponent */.up)("source-upload")

  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div", null, [
    (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_source_upload, {
      class: "source-upload",
      ref: "su",
      onSubmitSource: $options.submitSource,
      onStoreSource: $options.storeSource,
      onUpdateSourceDraft: $options.updateSourceDraft
    }, null, 8 /* PROPS */, ["onSubmitSource", "onStoreSource", "onUpdateSourceDraft"])
  ]))
}
// EXTERNAL MODULE: ./src/utils/assert.js
var assert = __webpack_require__(4442);
// EXTERNAL MODULE: ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
var runtime_dom_esm_bundler = __webpack_require__(9963);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/source/SourceUpload.vue?vue&type=template&id=8ab476fc&scoped=true


const _withScopeId = n => ((0,runtime_core_esm_bundler/* pushScopeId */.dD)("data-v-8ab476fc"),n=n(),(0,runtime_core_esm_bundler/* popScopeId */.Cn)(),n)
const _hoisted_1 = { class: "title-wrapper wrapper" }
const _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", { class: "w1" }, "标题:", -1 /* HOISTED */))
const _hoisted_3 = { class: "title-input-wrapper w2" }
const _hoisted_4 = { class: "cover-wrapper wrapper" }
const _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", { class: "w1" }, "封面:", -1 /* HOISTED */))
const _hoisted_6 = { class: "file-wrapper wrapper" }
const _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", { class: "w1" }, "文件:", -1 /* HOISTED */))
const _hoisted_8 = { class: "file-input-wrapper w2" }
const _hoisted_9 = { class: "cover" }
const _hoisted_10 = ["src"]
const _hoisted_11 = { class: "abstract-wrapper wrapper" }
const _hoisted_12 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", { class: "w1" }, "摘要:", -1 /* HOISTED */))
const _hoisted_13 = { class: "type-wrapper wrapper" }
const _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", { class: "w1" }, "分类:", -1 /* HOISTED */))
const _hoisted_15 = { class: "tag-wrapper wrapper" }
const _hoisted_16 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("h2", { class: "w1" }, "资源标签:", -1 /* HOISTED */))
const _hoisted_17 = { class: "submit-wrapper" }

function SourceUploadvue_type_template_id_8ab476fc_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_cover_upload = (0,runtime_core_esm_bundler/* resolveComponent */.up)("cover-upload")
  const _component_text_area = (0,runtime_core_esm_bundler/* resolveComponent */.up)("text-area")
  const _component_type_list = (0,runtime_core_esm_bundler/* resolveComponent */.up)("type-list")
  const _component_tag_list = (0,runtime_core_esm_bundler/* resolveComponent */.up)("tag-list")

  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("form", {
    class: "source-upload-wrapper",
    onSubmit: _cache[6] || (_cache[6] = (0,runtime_dom_esm_bundler/* withModifiers */.iM)(() => {}, ["prevent"]))
  }, [
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_1, [
      _hoisted_2,
      (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_3, [
        (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
          type: "text",
          "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.title) = $event))
        }, null, 512 /* NEED_PATCH */), [
          [runtime_dom_esm_bundler/* vModelText */.nr, $data.title]
        ])
      ])
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_4, [
      _hoisted_5,
      (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_cover_upload, {
        class: "cover-upload w2",
        ref: "coverUpload"
      }, null, 512 /* NEED_PATCH */)
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_6, [
      _hoisted_7,
      (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_8, [
        (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_9, [
          (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("i", null, "upload", 512 /* NEED_PATCH */), [
            [runtime_dom_esm_bundler/* vShow */.F8, !$data.fileIcon]
          ]),
          (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("img", {
            src: $data.fileIcon,
            alt: "FILE"
          }, null, 8 /* PROPS */, _hoisted_10), [
            [runtime_dom_esm_bundler/* vShow */.F8, $data.fileIcon]
          ])
        ]),
        (0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
          type: "file",
          name: "file",
          id: "file",
          ref: "fileInput",
          onInput: _cache[1] || (_cache[1] = $event => ($options.handleFileInput($event.target.files[0])))
        }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)
      ])
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_11, [
      _hoisted_12,
      (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_text_area, {
        class: "abstract-input w2",
        value: $data.digest,
        "onUpdate:value": _cache[2] || (_cache[2] = $event => (($data.digest) = $event))
      }, null, 8 /* PROPS */, ["value"])
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_13, [
      _hoisted_14,
      (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_type_list, {
        class: "type-list w2",
        types: _ctx.typeNames,
        typeSelect: $data.typeSelect,
        "onUpdate:typeSelect": _cache[3] || (_cache[3] = $event => (($data.typeSelect) = $event))
      }, null, 8 /* PROPS */, ["types", "typeSelect"])
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_15, [
      _hoisted_16,
      (0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_tag_list, {
        class: "tag-list w2",
        tags: $data.pubTags,
        onAddTag: $options.addTag,
        onDelTag: $options.delTag
      }, null, 8 /* PROPS */, ["tags", "onAddTag", "onDelTag"])
    ]),
    (0,runtime_core_esm_bundler/* createCommentVNode */.kq)(" <div class=\"original-wrapper wrapper\">\r\n      <h2 class=\"w1\">是否原创</h2>\r\n      <div class=\"w2\">\r\n        <input type=\"radio\" value=\"origin\" name=\"original\" id=\"original\"\r\n        v-model=\"original\">\r\n        <label for=\"original\">原创</label>\r\n        <input type=\"radio\" value=\"reprint\" name=\"original\" id=\"reprint\"\r\n        v-model=\"original\">\r\n        <label for=\"reprint\">转载</label>\r\n      </div>\r\n    </div> "),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_17, [
      (0,runtime_core_esm_bundler/* createElementVNode */._)("button", {
        class: "submit",
        onClick: _cache[4] || (_cache[4] = (0,runtime_dom_esm_bundler/* withModifiers */.iM)((...args) => ($options.submitSource && $options.submitSource(...args)), ["prevent"]))
      }, "发布"),
      (0,runtime_core_esm_bundler/* createElementVNode */._)("button", {
        class: "store",
        onClick: _cache[5] || (_cache[5] = (0,runtime_dom_esm_bundler/* withModifiers */.iM)((...args) => ($options.storeSource && $options.storeSource(...args)), ["prevent"]))
      }, "存草稿")
    ])
  ], 32 /* HYDRATE_EVENTS */))
}
;// CONCATENATED MODULE: ./src/pages/publish/components/source/SourceUpload.vue?vue&type=template&id=8ab476fc&scoped=true

// EXTERNAL MODULE: ./node_modules/vuex/dist/vuex.esm-bundler.js
var vuex_esm_bundler = __webpack_require__(894);
// EXTERNAL MODULE: ./src/utils/alert.js
var utils_alert = __webpack_require__(7759);
// EXTERNAL MODULE: ./src/components/utils/Input/TextArea.vue
var TextArea = __webpack_require__(8585);
// EXTERNAL MODULE: ./src/pages/publish/components/utils/TypeList.vue + 4 modules
var TypeList = __webpack_require__(8572);
// EXTERNAL MODULE: ./src/pages/publish/components/utils/TagList.vue + 4 modules
var TagList = __webpack_require__(1631);
// EXTERNAL MODULE: ./src/pages/publish/components/utils/CoverUpload.vue + 9 modules
var CoverUpload = __webpack_require__(4599);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/source/SourceUpload.vue?vue&type=script&lang=js









  /* harmony default export */ const SourceUploadvue_type_script_lang_js = ({
    components: {
      TextArea: TextArea/* default */.Z,
      TypeList: TypeList/* default */.Z,
      TagList: TagList/* default */.Z,
      CoverUpload: CoverUpload/* default */.Z
    },
    data() {
      return {
        title: '',
        typeSelect: [],
        original: 'origin',
        digest: '',
        file: null,
        fileIcon: '',
        pubTags: [],

        draftId: null,
      }
    },
    computed: {
      ...(0,vuex_esm_bundler/* mapState */.rn)(['typeNames', 'tagNames'])
    },
    methods: {
      addTag(tag) {
        if(this.pubTags.includes(tag)) {
          this.$alert('标签已经添加！');
        } else {
          this.pubTags.push(tag);
        }
      },
      delTag(idx) {
        this.pubTags.splice(idx, 1);
      },
      submitSource() {
        if(!this.$refs.coverUpload.checkCover()) {
          this.$alert({
            type: 'error',
            content: '请上传封面'
          });
          return;
        }
        if(this.typeSelect.every(e => !e)) {
          this.$alert({
            type: 'error',
            content: '请选择分类'
          });
          return;
        }
        this.cover = this.$refs.coverUpload.getCover();
        if(this.cover) {
          this.$compressImage(this.cover).then(res => {
            this.cover = res;
            this.$emit('submitSource', {
              cover: this.cover,
              title: this.title,
              file: this.file,
              tag: this.pubTags.join(','),
              type: this.typeNames.filter((e, idx) => this.typeSelect[idx]).join(','),
              original: this.original === 'origin' ? 1 : 0,
              digest: this.digest
            });
          })
        } else {
            this.$emit('submitSource', {
              title: this.title,
              file: this.file,
              tag: this.pubTags.join(','),
              type: this.typeNames.filter((e, idx) => this.typeSelect[idx]).join(','),
              original: this.original === 'origin' ? 1 : 0,
              digest: this.digest
            });
        }
      },
      storeSource() {
        this.cover = this.$refs.coverUpload.getCover();
        if(this.cover) {
          this.$compressImage(this.cover).then(res => {
            this.cover = res;
            let data = {
              draft_id: this.draftId,
              cover: this.cover,
              title: this.title,
              file: this.file,
              tag: this.pubTags.join(','),
              type: this.typeNames.filter((e, idx) => this.typeSelect[idx]).join(','),
              original: this.original === 'origin' ? 1 : 0,
              digest: this.digest
            };
            if(this.draftId) {
              (0,utils_alert/* confirm */.i)("是否覆盖原草稿?", flag => {
                if(flag) {
                  this.$emit('updateSourceDraft', data);
                } else {
                  this.$emit('storeSource', data);
                }
              });
              
            } else {
              this.$emit('storeSource', data);
            }
          })
        } else {
          let data = {
            draft_id: this.draftId,
            title: this.title,
            file: this.file,
            tag: this.pubTags.join(','),
            type: this.typeNames.filter((e, idx) => this.typeSelect[idx]).join(','),
            original: this.original === 'origin' ? 1 : 0,
            digest: this.digest
          }
          if(this.draftId) {
            (0,utils_alert/* confirm */.i)("是否覆盖原草稿?", flag => {
              if(flag) {
                this.$emit('updateSourceDraft', data);
              } else {
                this.$emit('storeSource', data);
              }
            });
            
          } else {
            this.$emit('storeSource', data);
          }
        }
      },
      handleFileInput(file) {
        console.log('handle file input');
        if(file) {
          this.file = file;
          this.fileIcon = this.$getFileIcon(file.name);
        }
      },
      fillDraft(draft) {
        this.draftId = draft.source_id;
        this.title = draft.title;
        this.$refs.coverUpload.fillCoverByUrl(draft.cover);
        this.original = draft.original ? 'origin' : 'reprint';
        this.digest = draft.digest;
        let typeSelect = new Array(this.typeNames.length);
        this.typeNames.forEach((type, idx) => {
          if(draft.type.includes(type)) typeSelect[idx] = true;
        });
        this.typeSelect = typeSelect;
        this.pubTags = draft.tag;
        fetch(this.$baseURL + draft.file).then(res => {
          res.blob().then(blob => {
            let filename = this.$file.getFileName(draft.file)
            this.file = new File([blob], filename);
            this.fileIcon = this.$getFileIcon(filename);
          })
        })
      }
    },
  });

;// CONCATENATED MODULE: ./src/pages/publish/components/source/SourceUpload.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/pages/publish/components/source/SourceUpload.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(SourceUploadvue_type_script_lang_js, [['render',SourceUploadvue_type_template_id_8ab476fc_scoped_true_render],['__scopeId',"data-v-8ab476fc"]])

/* harmony default export */ const SourceUpload = (__exports__);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/PubSource.vue?vue&type=script&lang=js





  /* harmony default export */ const PubSourcevue_type_script_lang_js = ({
    components: {
      SourceUpload: SourceUpload,
    },
    data() {
      return {
        draft: null
      }
    },
    watch: {
      $route: {
        handler(nv, ov) {
          if(nv.path === '/publish/source'){
            (0,assert/* assertLogin */.s)(flag => {
              if(flag) {
                 this.fillDraft();
              } else {
                window.open('/', "_self")
              }
            })
          }
        },
        immediate: true
      }
    },
    methods: {
      submitSource(infos) {
        this.$store.commit('pubSource', infos);
      },
      storeSource(infos) {
        this.$store.commit('storeSource', infos);
      },
      updateSourceDraft(infos) {
        this.$store.commit('updateSourceDraft', infos);
      },
      
      fillDraft() {
        let draftId = this.$route.query.draft;
        if(draftId === undefined) {
          this.$fetch({
            name: 'source draft',
            url: 'creator/manage/source/draft',
            method: 'GET',
            callback: res => {
              if(res.data.success) {
                if(res.data.object[0]) {
                  let draftId = res.data.object[0].source_id;
                  this.$fetch({
                    name: 'neweset source draft',
                    url: 'creator/source/draft',
                    method: 'POST',
                    data: {
                      id: draftId
                    },
                    callback: res => {
                      if(res.data.success) {
                        this.draft = res.data.object;
                        this.$refs.su.fillDraft(this.draft);
                        this.$alert("已获取最新草稿");
                      } else {
                        this.$alert({
                          type: 'error',
                          content: '草稿获取失败'
                        })
                      }
                    }
                  })
                }
              } else {
                this.$alert({
                  type: 'error',
                  content: '草稿获取失败'
                });
              }
            }
          })
        }
        else {
          this.$fetch({
          name: 'source draft',
          url: 'creator/source/draft',
          method: 'POST',
          data: {
            id: draftId
          },
          callback: res => {
            if(res.data.success) {
              this.draft = res.data.object;
              this.$refs.su.fillDraft(this.draft);
            } else {
              this.$alert({
                type: 'error',
                content: '获取草稿失败'
              })
            }
          }
        })
        }
      }
    },
  });

;// CONCATENATED MODULE: ./src/pages/publish/components/PubSource.vue?vue&type=script&lang=js
 
;// CONCATENATED MODULE: ./src/pages/publish/components/PubSource.vue




;


const PubSource_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(PubSourcevue_type_script_lang_js, [['render',render],['__scopeId',"data-v-36e3e39d"]])

/* harmony default export */ const PubSource = (PubSource_exports_);

/***/ }),

/***/ 4599:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ CoverUpload)
});

// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
// EXTERNAL MODULE: ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
var runtime_dom_esm_bundler = __webpack_require__(9963);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/CoverUpload.vue?vue&type=template&id=c182d43a&scoped=true


const _withScopeId = n => ((0,runtime_core_esm_bundler/* pushScopeId */.dD)("data-v-c182d43a"),n=n(),(0,runtime_core_esm_bundler/* popScopeId */.Cn)(),n)
const _hoisted_1 = { class: "cover-upload-wrapper" }
const _hoisted_2 = { class: "cover-radio" }
const _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("label", { for: "singleCover" }, "单封面", -1 /* HOISTED */))
const _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */._)("label", { for: "noCover" }, "无封面", -1 /* HOISTED */))

function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_image_input = (0,runtime_core_esm_bundler/* resolveComponent */.up)("image-input")

  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("div", _hoisted_1, [
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", _hoisted_2, [
      (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
        type: "radio",
        value: "1",
        name: "coverType",
        id: "singleCover",
        checked: "",
        "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (($data.coverNum) = $event))
      }, null, 512 /* NEED_PATCH */), [
        [runtime_dom_esm_bundler/* vModelRadio */.G2, $data.coverNum]
      ]),
      _hoisted_3,
      (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
        type: "radio",
        name: "coverType",
        id: "noCover",
        value: "0",
        "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.coverNum) = $event))
      }, null, 512 /* NEED_PATCH */), [
        [runtime_dom_esm_bundler/* vModelRadio */.G2, $data.coverNum]
      ]),
      _hoisted_4
    ]),
    (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createVNode */.Wm)(_component_image_input, {
      class: "cover-upload",
      image: $data.cover,
      "onUpdate:image": _cache[2] || (_cache[2] = $event => (($data.cover) = $event))
    }, null, 8 /* PROPS */, ["image"]), [
      [runtime_dom_esm_bundler/* vShow */.F8, parseInt($data.coverNum)]
    ])
  ]))
}
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/CoverUpload.vue?vue&type=template&id=c182d43a&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/Input/ImageInput.vue?vue&type=template&id=813c8588&scoped=true


const ImageInputvue_type_template_id_813c8588_scoped_true_withScopeId = n => (_pushScopeId("data-v-813c8588"),n=n(),_popScopeId(),n)
const ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_1 = { class: "image-input-wrapper" }
const ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_2 = { class: "image-submit-cover" }
const ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_3 = ["src"]

function ImageInputvue_type_template_id_813c8588_scoped_true_render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("form", ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_1, [
    (0,runtime_core_esm_bundler/* createElementVNode */._)("div", ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_2, [
      (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("img", {
        ref: "cover",
        src: $data.imageUrl,
        alt: "image",
        class: "cover-image"
      }, null, 8 /* PROPS */, ImageInputvue_type_template_id_813c8588_scoped_true_hoisted_3), [
        [runtime_dom_esm_bundler/* vShow */.F8, $data.imageUrl]
      ]),
      (0,runtime_core_esm_bundler/* withDirectives */.wy)((0,runtime_core_esm_bundler/* createElementVNode */._)("span", null, "upload", 512 /* NEED_PATCH */), [
        [runtime_dom_esm_bundler/* vShow */.F8, !$data.imageUrl]
      ])
    ]),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("input", {
      type: "file",
      name: "image",
      class: "image-input",
      ref: "imageInput",
      onInput: _cache[0] || (_cache[0] = $event => ($options.handleInput($event)))
    }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)
  ]))
}
;// CONCATENATED MODULE: ./src/components/utils/Input/ImageInput.vue?vue&type=template&id=813c8588&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/components/utils/Input/ImageInput.vue?vue&type=script&lang=js

  /* harmony default export */ const ImageInputvue_type_script_lang_js = ({
    emits: ['update:image'],
    props: {
      image: {
        type: File,
        default: null
      },
    },
    data() {
      return {
        imageUrl: ""
      }
    },
    watch: {
      image(newValue) {
        if(!(newValue instanceof Blob)) return;
        let reader = new FileReader();
        reader.addEventListener('load', () => {
          this.imageUrl = reader.result;
        });
        reader.readAsDataURL(this.image);
      }
    },
    methods: {
      handleInput(event) {
        this.$emit('update:image', event.target.files[0]);
      }
    },
  });

;// CONCATENATED MODULE: ./src/components/utils/Input/ImageInput.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/components/utils/Input/ImageInput.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(ImageInputvue_type_script_lang_js, [['render',ImageInputvue_type_template_id_813c8588_scoped_true_render],['__scopeId',"data-v-813c8588"]])

/* harmony default export */ const ImageInput = (__exports__);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/CoverUpload.vue?vue&type=script&lang=js



  /* harmony default export */ const CoverUploadvue_type_script_lang_js = ({
    components: {
      ImageInput: ImageInput,
    },
    props: {
    },
    data() {
      return {
        coverNum: "1",
        cover: null,
      }
    },
    methods: {
      updateCover(image) {
        this.cover = image;
      },
      checkCover() {
        return parseInt(this.coverNum) && this.cover || !parseInt(this.coverNum);
      },
      getCover() {
        return parseInt(this.coverNum) ? this.cover : null;
      },
      fillCoverByUrl(url) {
        if(!url) {
          this.coverNum = "0";
        }

        this.$file.imgurlToImg(this.$baseURL + url).then(img => {
          return this.$file.imgToCanvas(img);
        }).then(canvas => {
          this.$file.canvasToBlob(canvas, 1, blob => {
            this.cover = new File([blob], this.$file.getFileName(url));
          })
        })
      }
    },
  });

;// CONCATENATED MODULE: ./src/pages/publish/components/utils/CoverUpload.vue?vue&type=script&lang=js
 
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/CoverUpload.vue




;


const CoverUpload_exports_ = /*#__PURE__*/(0,exportHelper/* default */.Z)(CoverUploadvue_type_script_lang_js, [['render',render],['__scopeId',"data-v-c182d43a"]])

/* harmony default export */ const CoverUpload = (CoverUpload_exports_);

/***/ }),

/***/ 1631:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ TagList)
});

// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
// EXTERNAL MODULE: ./node_modules/@vue/shared/dist/shared.esm-bundler.js
var shared_esm_bundler = __webpack_require__(3577);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/TagList.vue?vue&type=template&id=11b33240&scoped=true


const _withScopeId = n => (_pushScopeId("data-v-11b33240"),n=n(),_popScopeId(),n)
const _hoisted_1 = { class: "tag-list-wrapper clearfix" }
const _hoisted_2 = ["onClick"]
const _hoisted_3 = {
  type: "text",
  ref: "tagInput"
}

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("ul", _hoisted_1, [
    ((0,runtime_core_esm_bundler/* openBlock */.wg)(true), (0,runtime_core_esm_bundler/* createElementBlock */.iD)(runtime_core_esm_bundler/* Fragment */.HY, null, (0,runtime_core_esm_bundler/* renderList */.Ko)($props.tags, (tag, idx) => {
      return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("li", { key: idx }, [
        (0,runtime_core_esm_bundler/* createTextVNode */.Uk)((0,shared_esm_bundler/* toDisplayString */.zw)(tag) + " ", 1 /* TEXT */),
        (0,runtime_core_esm_bundler/* createElementVNode */._)("i", {
          class: "iconfont icon-cancel",
          onClick: $event => ($options.delTag(idx))
        }, null, 8 /* PROPS */, _hoisted_2)
      ]))
    }), 128 /* KEYED_FRAGMENT */)),
    (0,runtime_core_esm_bundler/* createElementVNode */._)("li", null, [
      (0,runtime_core_esm_bundler/* createElementVNode */._)("input", _hoisted_3, null, 512 /* NEED_PATCH */),
      (0,runtime_core_esm_bundler/* createElementVNode */._)("button", {
        class: "submit-button",
        onClick: _cache[0] || (_cache[0] = (...args) => ($options.addTag && $options.addTag(...args)))
      }, "+")
    ])
  ]))
}
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TagList.vue?vue&type=template&id=11b33240&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/TagList.vue?vue&type=script&lang=js

  /* harmony default export */ const TagListvue_type_script_lang_js = ({
    props: {
      tags: {
        type: Array,
        default: () => []
      },
    },
    methods: {
      addTag() {
        this.$emit('addTag', this.$refs.tagInput.value);
        this.$refs.tagInput.value = '';
      },
      delTag(idx) {
        this.$emit('delTag', idx);
      }
    },
  });

;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TagList.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TagList.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(TagListvue_type_script_lang_js, [['render',render],['__scopeId',"data-v-11b33240"]])

/* harmony default export */ const TagList = (__exports__);

/***/ }),

/***/ 8572:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {


// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ TypeList)
});

// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(6252);
// EXTERNAL MODULE: ./node_modules/@vue/shared/dist/shared.esm-bundler.js
var shared_esm_bundler = __webpack_require__(3577);
;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/TypeList.vue?vue&type=template&id=32678592&scoped=true


const _withScopeId = n => (_pushScopeId("data-v-32678592"),n=n(),_popScopeId(),n)
const _hoisted_1 = { class: "type-list-wrapper clearfix" }
const _hoisted_2 = ["onClick"]

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("ul", _hoisted_1, [
    ((0,runtime_core_esm_bundler/* openBlock */.wg)(true), (0,runtime_core_esm_bundler/* createElementBlock */.iD)(runtime_core_esm_bundler/* Fragment */.HY, null, (0,runtime_core_esm_bundler/* renderList */.Ko)($props.types, (type, idx) => {
      return ((0,runtime_core_esm_bundler/* openBlock */.wg)(), (0,runtime_core_esm_bundler/* createElementBlock */.iD)("li", {
        key: idx,
        class: (0,shared_esm_bundler/* normalizeClass */.C_)({
      bgSlightBlue: $props.typeSelect[idx],
      colorBlue: $props.typeSelect[idx]
    }),
        onClick: $event => ($options.toggleSelect(idx))
      }, (0,shared_esm_bundler/* toDisplayString */.zw)(type), 11 /* TEXT, CLASS, PROPS */, _hoisted_2))
    }), 128 /* KEYED_FRAGMENT */))
  ]))
}
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TypeList.vue?vue&type=template&id=32678592&scoped=true

;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[12].use[0]!./src/pages/publish/components/utils/TypeList.vue?vue&type=script&lang=js

  /* harmony default export */ const TypeListvue_type_script_lang_js = ({
    props: {
      types: {
        type: Array,
        default: () => []
      },
      typeSelect: {
        type: Array
      }
    },
    emits: ['update:typeSelect'],
    methods: {
      toggleSelect(idx) {
        let update = Array.from(this.typeSelect);
        update[idx] = !update[idx];
        this.$emit('update:typeSelect', update);
      }
    },
  });

;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TypeList.vue?vue&type=script&lang=js
 
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(3744);
;// CONCATENATED MODULE: ./src/pages/publish/components/utils/TypeList.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(TypeListvue_type_script_lang_js, [['render',render],['__scopeId',"data-v-32678592"]])

/* harmony default export */ const TypeList = (__exports__);

/***/ }),

/***/ 1061:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (/* reexport safe */ _node_modules_vue_loader_dist_index_js_ruleSet_1_rules_12_use_0_TextArea_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__.Z)
/* harmony export */ });
/* harmony import */ var _node_modules_vue_loader_dist_index_js_ruleSet_1_rules_12_use_0_TextArea_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6766);
 

/***/ }),

/***/ 6076:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "s": () => (/* reexport safe */ _node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_1_node_modules_vue_loader_dist_index_js_ruleSet_1_rules_12_use_0_TextArea_vue_vue_type_template_id_8551dff6_scoped_true__WEBPACK_IMPORTED_MODULE_0__.s)
/* harmony export */ });
/* harmony import */ var _node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_1_node_modules_vue_loader_dist_index_js_ruleSet_1_rules_12_use_0_TextArea_vue_vue_type_template_id_8551dff6_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9918);


/***/ }),

/***/ 9918:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "s": () => (/* binding */ render)
/* harmony export */ });
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6252);


const _withScopeId = n => (_pushScopeId("data-v-8551dff6"),n=n(),_popScopeId(),n)
const _hoisted_1 = { class: "text-area-wrapper" }
const _hoisted_2 = ["value"]

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return ((0,vue__WEBPACK_IMPORTED_MODULE_0__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createElementBlock */ .iD)("div", _hoisted_1, [
    (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createElementVNode */ ._)("textarea", {
      name: "abstract",
      value: $props.value,
      onInput: _cache[0] || (_cache[0] = $event => ($options.handleInput($event))),
      cols: "30",
      rows: "5"
    }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_2)
  ]))
}

/***/ }),

/***/ 4442:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "s": () => (/* binding */ assertLogin)
/* harmony export */ });
/* harmony import */ var _alert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7759);


function assertLogin(cb) {
  if(!window.sessionStorage.getItem('isLogin')) {
    (0,_alert__WEBPACK_IMPORTED_MODULE_0__/* .alert */ .Z)({
      type: 'error',
      content: '请先登录'
    }, cb);
  } else {
    if(typeof cb === 'function') cb(true);
  }
}



/***/ })

}]);